package com.sportswork.sportswork.core.service.impl;

import com.sportswork.sportswork.core.entity.Info;
import com.sportswork.sportswork.core.mapper.ClassMapper;
import com.sportswork.sportswork.core.mapper.InfoMapper;
import com.sportswork.sportswork.core.service.IInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author dengwei
 * @date 2020/2/3 12:02
 * @description
 */
@Slf4j
@Service
@Transactional
public class InfoServiceImp implements IInfoService {

    @Resource
    private InfoMapper infoMapper;


    @Override
    public Info addInfo(Info info) {
        infoMapper.addInfo(info);
        return info;
    }

    @Override
    public Info getInfo(String id) {
        return infoMapper.getInfo(id);
    }

    @Override
    public Info getInfoByNumber(String number) {
        return infoMapper.getInfoByNumber(number);
    }

    @Override
    public List<Info> getAllInfos(String title) {
        return infoMapper.getAllInfos(title);
    }

    @Override
    public void deleteInfo(String id) {
        infoMapper.deleteInfo(id);
    }

    @Override
    public void deleteInfos(String ids) {
        infoMapper.deleteInfos(ids);
    }

    @Override
    public Info setInfo(Info info) {
        infoMapper.setInfo(info);
        return info;
    }
}
